package com.ztjava.core.utiliy;

import java.io.File;

import com.jfinal.kit.PathKit;

public class PathUtil {
	/***
	 * 获取应用所在文件夹，如APP
	 * 
	 * @return
	 */
	public static String getAppFolder() {
		String path = PathKit.getWebRootPath();
		if (path.endsWith(File.separator)) {
			path = path.substring(0, path.length() - 1);
		}
		return path.substring(path.lastIndexOf(File.separator) + 1,path.length());
	}
	

	/***
	 * 获取webapp所在文件夹系统路径，包含盘符
	 * 
	 * @return
	 */
	public static String getWebPath(){
		String path = PathKit.getWebRootPath();
		if(path.endsWith(File.separator)){
			path = path.substring(0, path.length()-1);
		}
		path = path.substring(0,path.lastIndexOf(File.separator));
		return path;
	}
}
